1. Field of the Invention
The present invention generally relates to computer systems, and more particularly to a method of providing a debugger for a computer operating system.
2. Description of the Prior Art
The basic structure of a conventional computer system 10 is shown in FIG. 1. The heart of computer system 10 is a central processing unit (CPU) or processor 12 which is connected to several peripheral devices, including input/output (I/O) devices 14 (such as a display monitor and keyboard) for the user interface, a permanent memory device 16 (such as a hard disk or floppy diskette) for storing the computer's operating system and user programs, and a temporary memory device 18 (such as random access memory or RAM) that is used by processor 12 to carry out program instructions. Processor 12 communicates with the peripheral devices by various means, including a bus 20 or a direct channel 22. Computer system 10 may have many additional components which are not shown, such as serial and parallel ports for connection to, e.g., modems or printers. Those skilled in the art will further appreciate that there are other components that might be used in conjunction with those shown in the block diagram of FIG. 1; for example, a display adapter connected to processor 12 might be used to control a video display monitor.
Computer system 10 also includes firmware 24 whose primary purpose is to seek out and load an operating system from one of the peripherals (usually permanent memory device 16) whenever the computer is first turned on. The process of seeking out and loading the operating system is referred to as "booting" the computer. Computer system 10 may be designed to allow firmware 24 to initialize (or re-initialize) a operating system without turning the computer off and back on again (a "soft" boot). Firmware 24 is essentially a series of machine instructions which are typically stored in a read-only storage (ROS) device, such as read-only memory (ROM). After power to computer system 10 is turned on (or a soft boot command has been received), processor 12 begins to execute the firmware instructions and seeks out an operating system. If an operating system is found, it is loaded into temporary memory 18. Thereafter, the operating system allows other application layers to be added, i.e., user software programs. In this manner, a given computer hardware construction can be adapted to run a variety of operating systems and user applications.
The foregoing description generally applies to any type of operating system, including two popular operating systems known as MSDOS and UNIX (MSDOS is a trademark of Microsoft Corp.; UNIX is a trademark of UNIX System Laboratories), but the present invention has particular application to UNIX. UNIX is a multi-user, multi-tasking operating system which is available from a variety of sources with different versions. These include, among others, System V (American Telephone & Telegraph), AIX (International Business Machines) and Mach (NeXT Computers). FIG. 2 illustrates a typical boot image 26 that is loaded as a UNIX operating system. Boot image 26 includes a base kernel portion 28 and a boot filesystem portion 30. Kernel 28, which is the core of the operating system, acts as the intermediary between user programs and hardware devices and includes, among other things, device drivers. Boot filesystem 30 is the RAM-based file system that provides supplemental features of the operating system such as user commands to manipulate computer objects, such as files, directories and symbolic links. When firmware 24 sees boot image 26 (such as on a floppy diskette, hard disk CD-ROM disk), it transfers control to that operating system (kernel 28) after loading it.
A given operating system can be adapted to run on various types of hardware platforms. With some operating systems, such as MSDOS, the operating system is fairly independent of the hardware platform, i.e., a given copy of the MSDOS operating system can be used to boot computers manufactured by many sources, since the hardware architecture and BIOS (basic input and output system) functions remain constant from manufacturer to manufacturer. Other operating systems, like UNIX, are less portable due to significant differences between the various types of hardware that have been designed to run UNIX. In this regard, boot filesystem 30 includes information that is hardware dependent, such as the PAL (Portability Assist Layer, or Platform Abstraction Layer), which contains the specific instructions for communicating with the particular hardware devices of a given manufacturer.
One area where hardware dependencies can create difficulties is in "debugging" of the operating system. A "bug" is a software error in the operating system, and debugging refers to the process of identifying the error, usually by examining the values in various processor registers or memory addresses. Every operating system has a debugger program. Some minimum hardware support is required for debugging, such as for a display console which is typically connected to the computer system via a serial port. In a UNIX-type operating system, software support for the console can be provided by binding a static debugger driver in the kernel, as shown in FIG. 2. If this is done, however, the kernel contains system-specific code that may need to be modified if the system is ported to a system architecture having a new I/O subsystem, such as a different display device or keyboard. This rebinding the kernel presents problems in manufacture and distribution of operating system media.
One technique for removing hardware dependence for debugging is by providing a dynamically loaded driver for the debugger. As shown in FIG. 3, a UNIX-type operating system can implement such a technique by providing a dynamic debugger driver in the boot filesystem, that is, in the PAL. The primary problem encountered with this approach is that the computer operator may want or need to debug the operating system at a time prior to loading of the PAL (i.e., during system initialization). Since the debugger is not available until late in the boot process, millions of instructions can pass before the output of the debugger can be examined (viewed on the console). It would, therefore, be desirable and advantageous to devise a method of providing a model-specific operating system debugger without limiting the hardware that the kernel can run on. It would be further advantageous if the method could allow delay of debugger functionality to a later time when debugger support can be added.